<template>
	<Container>
		<view class="header">
			<view class="header-content" :style="{ background: 'url(' + assignment.backgroundUrl + ')0 0/100% 100%' }">
				<image
					v-for="(item, index) in assignment.articles"
					:key="index"
					:src="item.imageUrl"
					:class="{ articleLight: index === speakCurrent }"
					:style="{
						position: 'absolute',
						width: item.width,
						height: item.height,
						top: item.top,
						left: item.left
					}"
				></image>
			</view>
			<AudioIcon @iconTap="iconTap" :questionPress="questionPress" />
		</view>
		<Question :question="questionWord" />
		<Record class="record" :ref="audio" @recordFinish="recordFinish" :isStart="questionPress" :answerText="assignment.answerTexts" :typeCode="assignment.typeCode" />
	</Container>
</template>

<script>
import { mixins } from '../../../common/mixins/assignmentDefault.js'
import { optionSpeak } from '../../../common/mixins/assignmentOptionSpeak.js'
import AudioIcon from '../audioIcon.vue'
import Question from '../questionName.vue'
import Container from '../container.vue'
import Record from '../record.vue'
export default {
	mixins: [mixins, optionSpeak],
	components: { AudioIcon, Question, Container, Record }
}
</script>

<style scoped lang="stylus">
.header
	height 50vh
	width 100%
	overflow hidden
	border-radius 70rpx
	border 12rpx solid #FCC77D
	box-sizing border-box
	transform translate3d(0, 0, 0)
	position relative
	margin 5vh 0
	.header-content
		position absolute
		height 100%
		width 1080rpx
		left 50%
		top 50%
		transform translate3d(-50%, -50%, 0)
		z-index 98
</style>
